'use strict';

module.exports = app => {
  const { STRING, INTEGER, TIME, SMALLINT } = app.Sequelize;

  const Task = app.model.define('task', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    task_id: STRING,
    gitlab_url: STRING,
    project_name: STRING,
    branch: STRING,
    reason: STRING,
    status: SMALLINT,
    preview_url: STRING,
    script: STRING,
    commit_id: STRING,
    preview_expire_time: TIME,
    create_time: TIME,
    update_time: TIME,
  }, {
    timestamps: false,
  });

  return Task;
};
